package cn.supermarket.mapper;


import cn.supermarket.pojo.dto.StockTimeAddDTO;
import cn.supermarket.pojo.dto.StockUpdateDTO;
import cn.supermarket.pojo.entity.StockTime;
import cn.supermarket.pojo.vo.StockDetailedVO;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 实时库存表---石彦春 Mapper 接口
 * </p>
 *
 * @author the shy
 * @since 2022-07-02
 */
@Repository
public interface StockTimeMapper {

    //查询实时库存
    BigDecimal selectCountsByProductId(Long productId);
    //增加实时库存
    void addProductCount(StockUpdateDTO stockUpdateDTO);
    //减少实时库存
    void reduceProductCount(StockUpdateDTO stockUpdateDTO);
    //删除库存条目
    void deleteByProductId(Long productId);
    //添加库存条目
    int addNew(StockTime stockTime);
    //判断是否存在
    Long isExist(Long productId);
    //查询库存详情
    StockDetailedVO selectDetailedByProductId(Long productId);
    //根据分类查询库存
    List<StockDetailedVO> selectByCategoryId(Long categoryId);
    //查询所有库存
    List<StockDetailedVO> selectAll();
    //查看库存预警
    List<StockDetailedVO> selectByWarningLine();
}
